/*
 * <p>Copyright® 2009-2022 东软 IT 实训中心版权所有。</p>
 */

package com.max.back.doctor.api;

import com.max.back.common.http.ResponseResult;
import com.max.back.doctor.service.DrugService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
* @description 
* 
* <p>
* <code>DrugApi</code>
*
* </p>
* @see 
* @author 辛凤文 forward.seen@foxmail.com
* @version 1.0 
* @time 2022/7/26 21:58 
*/
@RestController
@RequestMapping("/drug")
@CrossOrigin
public class DrugApi {

    @Autowired
    private DrugService drugService;

    @GetMapping("/searchDrugs")
    public ResponseResult<List<Map<String,Object>>> searchDrugs(String searchInput){
        List<Map<String, Object>> drugsBySearchContent = drugService.getDrugsBySearchContent(searchInput);
        return ResponseResult.getSuccessResult(drugsBySearchContent);
    }

}